import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { BasicDatabaseComponent } from './basic-database.component';
import { UserInfoResolver } from '../../core/service/auth/auth.resolve.service';
import { ZhongyaoyinpianComponent } from './components/zhongyaoyinpian/zhongyaoyinpian.component';
import { PeiwujinjiComponent } from './components/peiwujinji/peiwujinji.component';
import { ZhongchengyaoComponent } from './components/zhongchengyao/zhongchengyao.component';
import { JingdianfangComponent } from './components/jingdianfang/jingdianfang.component';
import { XiedingfangComponent } from './components/xiedingfang/xiedingfang.component';
import { DetailComponent } from './components/detail/detail.component';

const routes: Routes = [
	{
		path: '',
		component: BasicDatabaseComponent,
		resolve: {
			user: UserInfoResolver
		},
		children: [
			{
				path: '',
				component: ZhongyaoyinpianComponent,
				resolve: {
					user: UserInfoResolver
				},
			},
			{
				path: 'zhongyaoyinpian',
				component: ZhongyaoyinpianComponent,
				resolve: {
					user: UserInfoResolver
				},
			},
			{
				path: 'peiwujinji',
				component: PeiwujinjiComponent,
				resolve: {
					user: UserInfoResolver
				},
			},
			{
				path: 'zhongchengyao',
				component: ZhongchengyaoComponent,
				resolve: {
					user: UserInfoResolver
				},
			},
			{
				path: 'jingdianfang',
				component: JingdianfangComponent,
				resolve: {
					user: UserInfoResolver
				},
			},
			{
				path: 'xiedingfang',
				component: XiedingfangComponent,
				resolve: {
					user: UserInfoResolver
				},
			},
			{
				path: 'detail/:id/:type',
				component: DetailComponent,
				resolve: {
					user: UserInfoResolver
				},
			}
		]
	}
];

@NgModule({
	imports: [
		RouterModule.forChild(routes)
	],
	exports: [
		RouterModule
	]
})
export class BasicDatabaseRoutingModule {
	constructor() { }
}
